<?php
	require 'libraries/CostLib.php';
	require 'libraries/UserLibrary.php';
	session_start();
	checkSessionVariable("administrator", "AdministratorHomepage.php", NULL);
?>
<html>
	<head>
		<title>Analysis Portal</title>
	</head>
	<body>
	<p align="right">
		Hi, <?php echo $_SESSION["administrator"];?> | <a href="Logout.php">Log-out</a> | <a href="AdministratorHomepage.php"> Home </a>
	</p>
	<h1>View Analysis Cost Tree</h1>
	<?php
		$resultMain = getMainTypes("casl", "localhost", "editcost", "editcost");
		foreach ($resultMain as $strMain){
			echo $strMain."</br>";
			$resultSub = getSampleTypes($strMain, "casl", "localhost", "editcost", "editcost");
			foreach ($resultSub as $strSub){
				printf("<a href='ViewCost.php?mainType=%s&subType=%s'>%s</a></br>", $strMain, $strSub, $strSub);
			}
		}
	?>
	
	<input type="button" value="Back To Homepage" onClick='document.location.href = "AdministratorHomepage.php"'>
	</body>
</html>